'''
Created on Feb 20, 2013
@author: Rossi Kamal(rossi@khu.ac.kr)under supervision of Professor Dr Choong Seon Hong(cshong@khu.ac.kr)
Description: Univariate Variance(SMALL-SIGMA~2) Calculation
'''
import numpy as np
class UniVariateVarianceGenerator:
    #Constructor class for Univariate Variance Calculation
    def __init__(self,uni_variate_x,uni_variate_mean):
        self.uni_variate_x=uni_variate_x
        self.uni_variate_mean=uni_variate_mean
    #Method for calculating Variance
    def calculate_univariate_variance(self):
        variance=0.0
        for i in np.nditer(self.uni_variate_x): 
            variance=variance+(i-self.uni_variate_x)**2
        return variance/self.uni_variate_x.size